package com.springboot.redis.controller;


import com.springboot.redis.modle.TbRole;
import com.springboot.redis.service.TbRoleService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 角色表 前端控制器
 * </p>
 *
 * @author Dudu
 * @since 2021-01-06
 */
@RestController
@RequestMapping("/tbRole")
public class TbRoleController {

    @Resource
    TbRoleService tbRoleService;

    @GetMapping(value ="/getTbRole/{id}" )
    //@Cacheable(value = {"emp"})
    public List<TbRole> getTbRole(@PathVariable String id)
    {
        int i = 1/0;
        return tbRoleService.selectByID(id);
    }

    @PostMapping(value = "/insertTbRole")
    public Integer insertTbRole(@RequestBody TbRole tbRole)
    {
        return tbRoleService.insertTbRole(tbRole);
    }
}

